import * as types from '../type';

const state = {
  // 首页默认加载第几页，切换门店回来时需要
  index: 0
};
const actions = {
  /**
   * 请求首页信息
   */
  setIndex ({commit}, data) {
    commit(types.FIRST_INFO, data);
  }
};

const getters = {
  index: state => state.index
};

const mutations = {
  [types.FIRST_INFO] (state, res) {
    state.index = res;
  }
};

export default {
  state,
  actions,
  getters,
  mutations
};
